home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1236 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.5 KB

  1. Path: engnews2.Eng.Sun.COM!usenet
  2. From: nitin@more.eng.sun.com (Nitin More [CONTRACTOR])
  3. Newsgroups: comp.lang.c++
  4. Subject: Virtual functions in derived classes
  5. Date: 10 Jan 1996 01:06:06 GMT
  6. Organization: SunSoft
  7. Message-ID: <NITIN.96Jan9170606@more.eng.sun.com>
  8. References: <30ECA10F.3D99@ifu.net> <NITIN.96Jan5125830@more.eng.sun.com>
  9.     <4crquj$7t1@lib108.its.rpi.edu> <NITIN.96Jan9103242@more.eng.sun.com>
  10.     <ALUN.CHAMPION.96Jan9152102@g7240065.bridge.bst.bls.com>
  11. NNTP-Posting-Host: more.eng.sun.com
  12. In-reply-to: Alun.Champion@bridge.bst.bls.com's message of 09 Jan 1996 20:21:02 GMT
  13.  
  14.  
  15.  
  16. Alan,
  17.  
  18. Thanks for clarifying that ...
  19.  
  20. > 2   If a virtual member function vf is declared in a class Base and in a class
  21. >     Derived, derived directly or indirectly from Base, a member function vf with
  22. >     the same name and same parameter list as Base::vf is declared, then
  23. >     Derived::vf is also virtual (whether or not it is so declared) and it
  24. >     overrides Base::vf. ...
  25. > ...
  26.  
  27.  
  28. This is Yuck!  since sometimes you might not want the user of your class
  29. library to overwrite your methods but want to use the virtual methods in
  30. implementing the class library.  
  31.  
  32. -Nitin
  33. -- 
  34. ----------------------------------------------------------------------
  35. Nitin More                                                         
  36. SunSoft, Bldg 16  Off: (415) 786 7109                                 
  37. Menlo Park, CA    Fax: (415) 786 7957   e-mail: nitin@more.eng.sun.com
  38. ----------------------------------------------------------------------
  39.